Method and electronic device for providing ambient sound when user is in danger

ABSTRACT

An electronic device is disclosed which may collect inertia information and ambient sound, determine whether a user is in danger by monitoring impact sound and a mismatch between a head orientation and a moving direction of a user, and provide the ambient sound collected when it is determined that the user is in danger.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a bypass continuation application of InternationalApplication No. PCT/KR2022/007471, filed in the Korean IntellectualProperty Receiving Office on May 26, 2022, and claiming priority toKorean Patent Application No. 10-2021 0078731, filed in the KoreanIntellectual Property Office on Jun. 17, 2021, the entire disclosure ofeach of which are incorporated herein by reference.

BACKGROUND 1. Field

The present disclosure relates generally to a method of providingambient sound when a user is in danger.

2. Description of Related Art

A stereo headset may primarily shield external sound by mechanicallyenclosing an ear of a user with an earcup, and may provide a functionthat additionally reduces external sound. This function may provide theuser with a focused experience with music by shielding external noise.

Since the stereo headset provides stronger acoustical isolation andhigher immersion than earbuds, a user scenario is typically one wherethe user is sitting and listening to music rather than moving as withearbuds. However, as true wireless stereo (TWS) technology develops, theuser may move relatively freely while wearing a stereo headset.

However, the user may not recognize an external situation due to noiseshielding, and may not receive auditory information in case of anemergency. The user wearing the stereo headset may be insensitive todetecting impact around the user, compared to a user wearing earbuds,and may be more frequently exposed to an unexpected situation anddanger.

SUMMARY

An aspect of the present disclosure provides an electronic device fordetermining whether to provide ambient sound based on whether adirection of gaze of a user, who wears a stereo headset device, match amoving direction.

An aspect of the present disclosure provides an electronic device fordetermining whether to provide ambient sound based on a head rotationspeed of a user, who wears a stereo headset device.

An aspect of the present disclosure provides an electronic device fordetermining whether to provide ambient sound based on a volume level ofthe ambient sound around a user, who wears a stereo headset device.

According to an embodiment, an electronic device includes an inertiasensor configured to sense inertia of the electronic device while theelectronic device is worn on an ear of a user; a processor configured tomonitor a mismatch between a moving direction and a head orientation ofthe user by using inertia information on the sensed inertia, anddetermine whether the user is in danger based on a result of monitoringthe mismatch between the moving direction and the head orientation; asound sensor configured to collect ambient sound; and a pair of speakersconfigured to output collected ambient sound while the user is indanger.

According to an embodiment, a method performed by an electronic deviceincludes sensing inertia of the electronic device while the electronicdevice is worn on an ear of a user; monitoring a mismatch between amoving direction and a head orientation of the user by using inertiainformation related to the sensed inertia; determining whether the useris in danger based on a result of monitoring the mismatch between themoving direction and the head orientation; and outputting collectedambient sound while determining that the user is in danger.

According to an embodiment, an electronic device includes an inertiasensor configured to sense inertia of the electronic device while theelectronic device is worn on an ear of a user; a sound sensor configuredto collect ambient sound; a processor configured to determine that theuser is in danger in response to a failure in detecting head rotation ofthe user by using inertia information related to the sensed inertia froma time point of detecting sound, which exceeds a threshold volume level,from ambient sound until a predetermined threshold response timeelapses; and a pair of speakers configured to output collected ambientsound while the user is in danger.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other aspects, features, and advantages of certainembodiments of the present disclosure will be more apparent from thefollowing detailed description, taken in conjunction with theaccompanying drawings, in which:

FIG. 1 is a block diagram of an electronic device according to anembodiment;

FIG. 2 illustrates an electronic device according to an embodiment;

FIG. 3 illustrates an acceleration sensing axis of an electronic deviceaccording to an embodiment;

FIG. 4 is a flowchart illustrating an operating method of an electronicdevice according to an embodiment;

FIGS. 5 and 6 illustrate an operation, performed by an electronicdevice, of determining danger based on whether a head of a user hasrotated, according to an embodiment;

FIGS. 7 to 10 illustrate an operation, performed by an electronicdevice, of determining danger based on a moving direction and a headorientation of a user, according to an embodiment;

FIGS. 11 and 12 illustrate an operation, performed by an electronicdevice, of determining danger based on a response of a user, accordingto an embodiment; and

FIG. 13 is a flowchart illustrating an operation, performed by anelectronic device, of determining danger based on head rotation, amismatch between a moving direction and a head orientation, and a userresponse, and providing ambient sound, according to an embodiment.

DETAILED DESCRIPTION

Hereinafter, embodiments will be described in detail with reference tothe accompanying drawings. When describing the embodiments withreference to the accompanying drawings, like reference numerals refer tolike elements and a repeated description related thereto will beomitted.

FIG. 1 is a block diagram illustrating an electronic device 101 in anetwork environment 100 according to an embodiment. Referring to FIG. 1, the electronic device 101 in the network environment 100 maycommunicate with an electronic device 102 via a first network 198 (e.g.,a short-range wireless communication network), or communicate with atleast one of an electronic device 104 or a server 108 via a secondnetwork 199 (e.g., a long-range wireless communication network). Theelectronic device 101 may communicate with the electronic device 104 viathe server 108. The electronic device 101 may include a processor 120, amemory 130, an input module 150, a sound output module 155, a displaymodule 160, an audio module 170, and a sensor module 176, an interface177, a connecting terminal 178, a haptic module 179, a camera module180, a power management module 188, a battery 189, a communicationmodule 190, a subscriber identification module (SIM) 196, and/or anantenna module 197. In some embodiments, at least one of the components(e.g., the connecting terminal 178) may be omitted from the electronicdevice 101, and/or one or more other components may be added in theelectronic device 101. Some of the components (e.g., the sensor module176, the camera module 180, or the antenna module 197) may be integratedas a single component (e.g., the display module 160).

The processor 120 may execute, for example, software (e.g., a program140) to control at least one other component (e.g., a hardware orsoftware component) of the electronic device 101 connected to theprocessor 120, and may perform various data processing or computationoperations. As at least a part of data processing or computationoperations, the processor 120 may store a command or data received fromanother component (e.g., the sensor module 176 or the communicationmodule 190) in a volatile memory 132, process the command or the datastored in the volatile memory 132, and store resulting data in anon-volatile memory 134. The processor 120 may include a main processor121 (e.g., a central processing unit (CPU) or an application processor(AP)), or an auxiliary processor 123 (e.g., a graphics processing unit(GPU), a neural processing unit (NPU), an image signal processor (ISP),a sensor hub processor, or a communication processor (CP)) that isoperable independently from, or in conjunction with the main processor121. For example, when the electronic device 101 includes the mainprocessor 121 and the auxiliary processor 123, the auxiliary processor123 may be adapted to consume less power than the main processor 121 orto be specific to a specified function. The auxiliary processor 123 maybe implemented separately from the main processor 121 or as a part ofthe main processor 121.

The auxiliary processor 123 may control at least some of functions orstates related to at least one (e.g., the display module 160, the sensormodule 176, or the communication module 190) of the components of theelectronic device 101, instead of the main processor 121 while the mainprocessor 121 is in an inactive (e.g., sleep) state or along with themain processor 121 while the main processor 121 is an active state(e.g., executing an application). The auxiliary processor 123 (e.g., anISP or a CP) may be implemented as a portion of another component (e.g.,the camera module 180 or the communication module 190) that isfunctionally related to the auxiliary processor 123. The auxiliaryprocessor 123 (e.g., an NPU) may include a hardware structure specifiedfor artificial intelligence model processing. An artificial intelligencemodel may be generated by machine learning. Such learning may beperformed by, for example, the electronic device 101 in which anartificial intelligence model is executed, or performed via a separateserver (e.g., the server 108). Learning algorithms may include, but arenot limited to, supervised learning, unsupervised learning,semi-supervised learning, or reinforcement learning. The artificialintelligence model may include a plurality of artificial neural networklayers. An artificial neural network may include, for example, a deepneural network (DNN), a convolutional neural network (CNN), a recurrentneural network (RNN), a restricted Boltzmann machine (RBM), a deepbelief network (DBN), and a bidirectional recurrent DNN (BRDNN), a deepQ-network, or a combination of two or more thereof, but is not limitedthereto. The artificial intelligence model may, additionally oralternatively, include a software structure other than the hardwarestructure.

The memory 130 may store various data used by at least one component(e.g., the processor 120 or the sensor module 176) of the electronicdevice 101. The various data may include, for example, software (e.g.,the program 140) and input data or output data for a command relatedthereto. The memory 130 may include the volatile memory 132 or thenon-volatile memory 134. The non-volatile memory 134 may include aninternal memory 136 and an external memory 138.

The program 140 may be stored as software in the memory 130, and mayinclude, for example, an operating system (OS) 142, middleware 144,and/or an application 146.

The input module 150 may receive a command or data to be used by anothercomponent (e.g., the processor 120) of the electronic device 101, fromthe outside (e.g., a user) of the electronic device 101. The inputmodule 150 may include, for example, a microphone, a mouse, a keyboard,a key (e.g., a button), and/or a digital pen (e.g., a stylus pen).

The sound output module 155 may output a sound signal to the outside ofthe electronic device 101. The sound output module 155 may include, forexample, a speaker or a receiver. The speaker may be used for generalpurposes, such as playing multimedia or playing recorded material. Thereceiver may be used to receive an incoming call. The receiver may beimplemented separately from the speaker or as a part of the speaker. Thesound output module 155 may include, for example, a pair of speakers.Each of the speakers may be placed on an ear of a user when theelectronic device is worn.

The display module 160 may visually provide information to the outside(e.g., a user) of the electronic device 101. The display module 160 mayinclude, for example, a control circuit for controlling a display, ahologram device, or a projector and control circuitry to control acorresponding one of the display, the hologram device, and theprojector. The display module 160 may include a touch sensor adapted todetect a touch, or a pressure sensor adapted to measure the intensity offorce incurred by the touch. The audio module 170 may convert a soundinto an electrical signal or vice versa.

The audio module 170 may obtain the sound via the input module 150 oroutput the sound via the sound output module 155 or an externalelectronic device (e.g., the electronic device 102 such as a speaker ora headphone) directly or wirelessly connected to the electronic device101.

The sensor module 176 may detect an operational state (e.g., power ortemperature) of the electronic device 101 or an environmental state(e.g., a state of a user) external to the electronic device 101, andgenerate an electric signal or data value corresponding to the detectedstate. The sensor module 176 may include, for example, a gesture sensor,a gyro sensor, an atmospheric pressure sensor, a magnetic sensor, aninertia sensor (e.g., a combination of an acceleration sensor and thegyro sensor), a grip sensor, a proximity sensor, a color sensor, aninfrared (IR) sensor, a biometric sensor, a temperature sensor, ahumidity sensor, an illuminance sensor, or a sound sensor (e.g., amicrophone). For example, the proximity sensor and the grip sensor mayfunction as a wear detecting sensor, which is described below.

The interface 177 may support one or more specified protocols to be usedfor the electronic device 101 to be coupled with the external electronicdevice (e.g., the electronic device 102) directly (e.g., wiredly) orwirelessly. The interface 177 may include, for example, ahigh-definition multimedia interface (HDMI), a universal serial bus(USB) interface, a secure digital (SD) card interface, and/or an audiointerface.

The connecting terminal 178 may include a connector via which theelectronic device 101 may be physically connected to an externalelectronic device (e.g., the electronic device 102). The connectingterminal 178 may include, for example, an HDMI connector, a USBconnector, an SD card connector, and/or an audio connector (e.g., aheadphone connector).

The haptic module 179 may convert an electrical signal into a mechanicalstimulus (e.g., a vibration or a movement) or an electrical stimuluswhich may be recognized by a user via his or her tactile sensation orkinesthetic sensation. The haptic module 179 may include, for example, amotor, a piezoelectric element, and/or an electric stimulator.

The camera module 180 may capture a still image and moving images. Thecamera module 180 may include one or more lenses, image sensors, imagesignal processors, and/or flashes.

The power management module 188 may manage power supplied to theelectronic device 101. The power management module 188 may beimplemented as, for example, at least a part of a power managementintegrated circuit (PMIC).

The battery 189 may supply power to at least one component of theelectronic device 101. The battery 189 may include, for example, aprimary cell which is not rechargeable, a secondary cell which isrechargeable, and/or a fuel cell.

The communication module 190 may support establishing a direct (e.g.,wired) communication channel or a wireless communication channel betweenthe electronic device 101 and the external electronic device (e.g., theelectronic device 102, the electronic device 104, and/or the server 108)and performing communication via the established communication channel.The communication module 190 may include one or more communicationprocessors that are operable independently of the processor 120 (e.g.,an AP) and that support a direct (e.g., wired) communication or awireless communication. The communication module 190 may include awireless communication module 192 (e.g., a cellular communicationmodule, a short-range wireless communication module, and/or a globalnavigation satellite system (GNSS) communication module) or a wiredcommunication module 194 (e.g., a local area network (LAN) communicationmodule, or a power line communication (PLC) module). A corresponding oneof these communication modules may communicate with the externalelectronic device 104 via the first network 198 (e.g., a short-rangecommunication network, such as Bluetooth™, wireless-fidelity (Wi-Fi)direct, or infrared data association (IrDA)) or the second network 199(e.g., a long-range communication network, such as a legacy cellularnetwork, a 5G network, a next-generation communication network, theInternet, or a computer network (e.g., a LAN or a wide area network(WAN)). These various types of communication modules may be implementedas a single component (e.g., a single chip), or may be implemented asmulti components (e.g., multi chips) separate from each other. Thewireless communication module 192 may identify and authenticate theelectronic device 101 in a communication network, such as the firstnetwork 198 or the second network 199, using subscriber information(e.g., international mobile subscriber identity (IMSI)) stored in theSIM 196.

The wireless communication module 192 may support a 5G network after a4G network, and next-generation communication technology, e.g., newradio (NR) access technology. The NR access technology may supportenhanced mobile broadband (eMBB), massive machine type communications(mMTC), or ultra-reliable and low-latency communications (URLLC). Thewireless communication module 192 may support a high-frequency band(e.g., an mmWave band) to achieve, for example, a high data transmissionrate. The wireless communication module 192 may support varioustechnologies for securing performance on a high-frequency band, such asbeamforming, massive multiple-input and multiple-output (massive MIMO),full dimensional MIMO (FD-MIMO), an array antenna, analog beam-forming,or a large scale antenna. The wireless communication module 192 maysupport various requirements specified in the electronic device 101, anexternal electronic device (e.g., the electronic device 104), or anetwork system (e.g., the second network 199). The wirelesscommunication module 192 may support a peak data rate (e.g., 20 Gbps ormore) for implementing eMBB, loss coverage (e.g., 164 dB or less) forimplementing mMTC, or U-plane latency (e.g., 0.5 ms or less for each ofdownlink (DL) and uplink (UL), or a round trip of 1 ms or less) forimplementing URLLC.

The antenna module 197 may transmit or receive a signal or power to orfrom the outside (e.g., the external electronic device) of theelectronic device 101. The antenna module 197 may include an antennaincluding a radiating element including a conductive material or aconductive pattern formed in or on a substrate (e.g., a printed circuitboard (PCB)). The antenna module 197 may include a plurality of antennas(e.g., array antennas). In such a case, at least one antenna appropriatefor a communication scheme used in a communication network, such as thefirst network 198 or the second network 199, may be selected by, forexample, the communication module 190 from the plurality of antennas.The signal or the power may be transmitted or received between thecommunication module 190 and the external electronic device via the atleast one selected antenna. Another component (e.g., a radio frequencyintegrated circuit (RFIC)) other than the radiating element may beadditionally formed as a part of the antenna module 197.

The antenna module 197 may form an mmWave antenna module. The mmWaveantenna module may include a PCB, an RFIC disposed on a first surface(e.g., the bottom surface) of the PCB, or adjacent to the first surfaceand capable of supporting a designated high-frequency band (e.g., themmWave band), and a plurality of antennas (e.g., array antennas)disposed on a second surface (e.g., the top or a side surface) of thePCB, or adjacent to the second surface and capable of transmitting orreceiving signals of the designated high-frequency band.

At least some of the above-described components may be coupled mutuallyand communicate signals (e.g., commands or data) therebetween via aninter-peripheral communication scheme (e.g., a bus, general purposeinput and output (GPIO), serial peripheral interface (SPI), or mobileindustry processor interface (MIPI)).

According to an embodiment, commands or data may be transmitted orreceived between the electronic device 101 and the external electronicdevice 104 via the server 108 coupled with the second network 199. Eachof the external electronic devices 102 or 104 may be a device of thesame type as or a different type from the electronic device 101. All orsome of operations to be executed by the electronic device 101 may beexecuted at one or more of the external electronic devices 102 and 104,and the server 108. For example, if the electronic device 101 needs toperform a function or a service automatically, or in response to arequest from a user or another device, the electronic device 101,instead of or in addition to executing the function or the service, mayrequest one or more external electronic devices to perform at least partof the function or the service. The one or more external electronicdevices receiving the request may perform the at least part of thefunction or the service requested, or an additional function or anadditional service related to the request, and may transfer an outcomeof the performing to the electronic device 101. The electronic device101 may provide the outcome, with or without further processing of theoutcome, as at least part of a reply to the request. To that end, acloud computing, distributed computing, mobile edge computing (MEC), orclient-server computing technology may be used, for example. Theelectronic device 101 may provide ultra low-latency services using,e.g., distributed computing or MEC. The external electronic device 104may also include an Internet-of-things (IoT) device. The server 108 maybe an intelligent server using machine learning and/or a neural network.The external electronic device 104 or the server 108 may be included inthe second network 199. The electronic device 101 may be applied tointelligent services (e.g., smart home, smart city, smart car, orhealthcare) based on 5G communication technology or IoT relatedtechnology.

The electronic device according to various embodiments may be one ofvarious types of electronic devices. The electronic device may include,for example, a portable communication device (e.g., a smartphone), acomputer device, a portable multimedia device, a portable medicaldevice, a camera, a wearable device (e.g., a stereo headset device), ora home appliance device, but is not limited to those described above.

It should be understood that various example embodiments of the presentdisclosure and the terms used therein are not intended to limit thetechnological features set forth herein to particular embodiments andinclude various changes, equivalents, or replacements for acorresponding embodiment. In connection with the description of thedrawings, like reference numerals may be used for similar or relatedcomponents. It is to be understood that a singular form of a nouncorresponding to an item may include one or more of the things, unlessthe relevant context clearly indicates otherwise. As used herein, “A orB”, “at least one of A and B”, “at least one of A or B”, “A, B or C”,“at least one of A, B and C”, and “A, B, or C”, each of which mayinclude any one of the items listed together in the corresponding one ofthe phrases, or all possible combinations thereof. Terms such as“first”, “second”, or “1st” or “2nd” may simply be used to distinguishthe component from other components in question, and may refer tocomponents in other aspects (e.g., importance or order) is not limited.It is to be understood that if an element (e.g., a first element) isreferred to, with or without the term “operatively” or“communicatively”, as “coupled with”, “coupled to”, “connected with”, or“connected to” another element (e.g., a second element), it means thatthe element may be coupled with the other element directly (e.g.,wiredly), wirelessly, or via a third element.

As used in connection with various example embodiments of thedisclosure, the term “module” may include a unit implemented inhardware, software, or firmware, and may interchangeably be used withother terms, for example, “logic”, “logic block”, “part”, or“circuitry”. A module may be a single integral component, or a minimumunit or part thereof, adapted to perform one or more functions. Forexample, according to an example embodiment, the module may beimplemented in a form of an application-specific integrated circuit(ASIC).

Various example embodiments as set forth herein may be implemented assoftware (e.g., the program 140) including one or more instructions thatare stored in a storage medium (e.g., the internal memory 136 or theexternal memory 138) that is readable by a machine (e.g., the electronicdevice 101) For example, a processor (e.g., the processor 120) of themachine (e.g., the electronic device 101) may invoke at least one of theone or more instructions stored in the storage medium, and execute it.This allows the machine to be operated to perform at least one functionaccording to the at least one instruction invoked. The one or moreinstructions may include a code generated by a compiler or a codeexecutable by an interpreter. The machine-readable storage medium may beprovided in the form of a non-transitory storage medium. Here, the term“non-transitory” simply means that the storage medium is a tangibledevice, and does not include a signal (e.g., an electromagnetic wave),but this term does not differentiate between where data issemi-permanently stored in the storage medium and where the data istemporarily stored in the storage medium.

A method according to various embodiments of the disclosure may beincluded and provided in a computer program product. The computerprogram product may be traded as a product between a seller and a buyer.The computer program product may be distributed in the form of amachine-readable storage medium (e.g., compact disc read only memory(CD-ROM)), or be distributed (e.g., downloaded or uploaded) online viaan application store (e.g., PlayStore™), or between two user devices(e.g., smart phones) directly. If distributed online, at least part ofthe computer program product may be temporarily generated or at leasttemporarily stored in the machine-readable storage medium, such asmemory of the manufacturer's server, a server of the application store,or a relay server.

According to various embodiments, each component (e.g., a module or aprogram) of the above-described components may include a single entityor multiple entities, and some of the multiple entities may beseparately disposed in different components. One or more of theabove-described components or operations may be omitted, or one or moreother components or operations may be added. Alternatively oradditionally, a plurality of components (e.g., modules or programs) maybe integrated into a single component. In such a case, the integratedcomponent may still perform one or more functions of each of theplurality of components in the same or similar manner as they areperformed by a corresponding one of the plurality of components beforethe integration. Operations performed by the module, the program, oranother component may be carried out sequentially, in parallel,repeatedly, or heuristically, or one or more of the operations may beexecuted in a different order or omitted, or one or more otheroperations may be added.

FIG. 2 illustrates an electronic device according to an embodiment.

An electronic device 200 may be a stereo headset device configured toprevent ambient sound (e.g., external noise) from being delivered to aneardrum of a user, and play sound provided by another electronic device(e.g., the electronic device 102 of FIG. 1 ) through a speaker 240. Theelectronic device 200 may include a wear detecting sensor 210, aninertia sensor 220, a sound sensor 230, the speaker 240, an earpiece250, a touch sensor 260, and a housing (e.g., a headband 270). Inaddition, the electronic device 200 may include a processor 120 and acommunication module 190. However, the shape of the electronic device200 as illustrated in FIG. 2 is an example, and the shape is not limitedthereto.

The wear detecting sensor 210 may sense whether the electronic device200 is worn on a head and/or an ear of a user, and may sense a posturein which the electronic device 200 is worn on a body part (e.g., thehead or neck) of a user. For example, the electronic device 200 may beworn on an ear or the neck of a user. A processor of the electronicdevice 200 may determine a body part on which the electronic device 200is worn, based on data obtained by sensing by the wear detecting sensor210. In addition, the electronic device 200 may determine whether theearpiece 250 is in a normal posture or a rotated posture in a backwarddirection with respect to the housing (e.g., the headband 270), based onthe data obtained by sensing by the wear detecting sensor 210. Aplurality of wear detecting sensors 210 may be provided, and each of thewear detecting sensors 210 may run independently. For example, a headproximity detecting sensor, which is one of the plurality of weardetecting sensors 210 and placed on part of the head, may include atleast one of a capacitive sensor and a resistive sensor, and an earproximity detecting sensor placed on the side of the ear may include anoptical sensor. Data obtained by sensing by the head proximity detectingsensor may be used for determining a wearing state (e.g., a normalposture or a rotated posture in which an earpiece is rotated in abackward direction). The ear proximity detecting sensor may include afirst ear proximity detecting sensor placed on an ear, and a second earproximity detecting sensor placed on the other ear. Data obtained bysensing by the ear proximity detecting sensor may be used fordetermining whether the earpiece is worn on an ear.

In the stereo headset device, an inner surface of the earpiece 250 maytypically face toward the inside (e.g., a space between the earpieces250). However, the inner surface of the earpiece 250 may be reversed toface toward the outside (e.g., an outer space, which is not the spacebetween the earpieces 250) by a mechanical joint structure between theearpiece 250 and the housing. Since sound of the speaker 240 may beoutput in a direction in which the inner surface of the earpiece 250faces, in case the earpiece 250 is reversed, a direction of outputtingthe sound may be reversed. In case one earpiece 250 of the pair ofearpieces 250 is reversed, the electronic device 200 may determine theproximity between the one earpiece 250 and a body part of a user.Accordingly, the electronic device 200 may determine various wearingstates, such as a normal wearing, wearing on one side, wearing theheadband 270 down on the neck, and wearing the stereo headset device onthe neck, based on various types of the stereo headset device.

The wear detecting sensor 210, for example, may include at least one ofa proximity sensor and a grip sensor.

The proximity sensor may be a sensor identifying proximity. Theelectronic device 200 may determine the above-described wearing state,based on data obtained by sensing by the proximity sensor. The proximitysensor may be, for example, an optical proximity sensor using an IR raylight-emitting diode (IR LED) and a photodiode. In the optical proximitysensor, a light receiver (e.g., the photodiode) may receive an opticalsignal emitted from a light emitter (e.g., the IR LED). The electronicdevice 200 may determine proximity based on a distance calculated by anintensity of received light or a time difference between light emissionand light reception. However, the example is not limited thereto, andthe proximity sensor may be implemented by an ultrasonic sensorconfigured to transmit and receive an ultrasonic wave. In the ultrasonicsensor, a transmitter may transmit an ultrasonic signal and a receivermay receive an ultrasonic signal. The electronic device 200 maydetermine proximity based on a distance calculated by an intensity of areceived ultrasonic signal or a time difference between transmission andreception of the ultrasonic wave.

The above-described proximity sensor may be placed on the outside and/orthe inside of the earpiece 250. The processor may obtain data (e.g., theabove-described signal reception intensity, the signal reception time,and the distance) related to proximity between the earpiece 250 and abody part (e.g., an ear) of the user, by sensing by the proximitysensor. A plurality of proximity sensors may be placed on one earpiece250. In addition, a proximity sensor may be mounted on each of theearpieces 250 (e.g., the earpiece 250 corresponding to the left ear andthe earpiece 250 corresponding to the right ear).

The proximity sensor may be mounted on the headband 270. Through sensingby the proximity sensor mounted on the headband 270, the processor mayobtain data related to whether the electronic device 200 is worn on theear(s) of the user. For example, although the earpiece 250 is worn onthe ear of the user, the headband 270 may be not worn on the top of thehead of the user. The electronic device 200 may include an additionalproximity sensor for determining the above-described various wearingstates.

The grip sensor may sense touch or contact by a capacitance method. Thegrip sensor may be placed on the earpiece 250 and/or the headband 270.When the electronic device 200 includes both the proximity sensor andthe grip sensor together, an error related to determining attachment ordetachment of the electronic device 200 may be prevented when the useris wearing the electronic device 200. In other words, the accuracy ofdetermining a wearing state may be improved by combining and using dataobtained by sensing by the proximity sensor and the grip sensor. Thegrip sensor may be, similar to the above-described proximity sensor,mounted on each of the earpieces 250. In addition, since the grip sensorand the touch sensor 260 have the same sensing and processing mechanism,the grip sensor and the touch sensor 260 may share and use oneprocessing module. However, the example is not limited thereto, and aprocessing module configured to process data of the grip sensor and thetouch sensor 260 may be divided into separate modules.

The inertia sensor 220 may be a sensor configured to sense inertia(e.g., force), and may sense an amount of pose change that occurred bymovement of the user. The processor may generate inertia information(e.g., acceleration data indicating an acceleration and angular velocitydata indicating an angular velocity) by sensing inertia obtained by theinertia sensor 220. For example, the inertia sensor 220 may include anacceleration sensor, a gyro sensor, or a combination of an accelerationsensor and a gyro sensor. The acceleration sensor may sense anacceleration with respect to three axes, and the gyro sensor may sensean angular velocity based on three axes. The inertia sensor 220 may bereferred to as a six-axis sensor. Alternatively, an integrated sensorintegrating the acceleration sensor with the gyro sensor may output anintegrated value integrating an output value of the acceleration sensorwith an output value of the gyro sensor, and may be referred to as asoftware (SW) sensor (e.g., a game rotation vector sensor). The inertiasensor 220 may be provided as a pair (e.g., two pieces) and may beaccommodated in each of the earpieces 250, and the pair of inertiasensors 220 may be connected to a single processor and may support fasthead tracking with low power consumption without time latency. Adisposition of a reference axis of the acceleration sensor and the gyrosensor is described with reference to FIG. 3 .

The sound sensor 230 may sense a sound signal. For example, the soundsensor 230 may sense and collect ambient sound and a voice of the user,and may be implemented as a microphone. The sound sensor 230 may sense asound signal caused by uttering of the user. The sound sensor 230 mayinclude a plurality of microphones. Based on a beam-forming technique,the electronic device 200 may recognize a voice uttered from the mouthof the user with a higher recognition rate, based on a comparisonbetween a sound signal obtained by sensing by a microphone placed closeto the mouth of the user and a sound signal obtained by sensing by amicrophone placed far from the mouth of the user.

In addition, sound sensors 230 placed on various portions of theelectronic device 200 may sense various external sounds. For example,each of the sound sensors 230 mounted on the first earpiece (e.g., theearpiece 250 equipped on the left ear), the second earpiece (e.g., theearpiece 250 equipped on the right ear), and the headband 270 of theelectronic device 200 may generate a sound signal by sensing sound at anindividual volume depending on a location of a sound source based on theelectronic device 200. The electronic device 200 may estimate adirection of the sound source based on the sound signal obtained bysensing by the sound sensor 230 mounted to each portion of theelectronic device 200. For example, in case sound signals having a samewaveform are sensed by sound sensors 230 placed on the earpieces 250 onthe left and right, a volume of the sound signal sensed by the soundsensor 230 placed on the left side (e.g., left earpiece) may be greaterthan a volume of the sound signal sensed by the sound sensor placed onthe right side. The electronic device 200 may determine that the soundsource causing the sound is on the left side of the electronic device200.

In addition, the electronic device 200 may utilize the sound sensor 230and the inertia sensor 220 as a voice pick-up (VPU) sensor fordetermining whether a user (hereinafter, a “wearer”) wearing theelectronic device 200 utters a sound. For example, the inertia sensor220 may sense subtle vibrations caused by the utterance. The electronicdevice 200 may determine whether the wearer utters a sound by connectinginertia data obtained by sensing the subtle vibration occurring due tothe utterance using the inertia sensor 220 with a sound signal obtainedby sensing by the sound sensor 230 (e.g., the microphone). Theelectronic device 200 may identify whether the sensed sound is a soundgenerated by the user or an external sound, by detecting the utterance.In other words, the electronic device 200 may accurately determinecontext of the sound source.

The speaker 240 may be a module configured to output sound. In case theelectronic device 200 worn on the ear of the user receives sound datafrom another external device, the speaker 240 may output soundcorresponding to the received sound data. Outputting the sound may bereferred to as playing or play back. The speaker 240 may include variouscomponents, such as a tweeter and/or a woofer.

The touch sensor 260 may sense a gesture, such as a swiping action andtouching by a finger of the user. In response to touch data obtained bysensing by the touch sensor 260, the electronic device 200 may performoperations including at least one or a combination of two or more ofplaying music, stop playing music, playing a next song, and playing aprevious song. FIG. 2 illustrates that the touch sensor 260 is placed onan outer surface (e.g., a surface facing an outer space, not a spacebetween earpieces) of the earpiece 250; however, this example is notlimited thereto.

As described with reference to FIG. 1 , the processor may include an AP,a CP, and/or an auxiliary processor. An operation of the processor isdescribed in detail with reference to FIGS. 4 to 13 .

The communication module may be a module configured to communicatewirelessly with the outside. The communication module may establishcommunication with another device and/or an access point via at leastone of a Bluetooth™ (BT) network, a wireless fidelity (Wi-Fi) network,an ANT+ network, a long-term evolution (LTE) network, a 5th generation(5G) network, and a narrowband IoT (NB-IoT) network, or a combination oftwo or more thereof. For reference, in the present disclosure, the pairof earpieces 250 of the electronic device 200 are connected by a wire inthe housing; however, this example is not limited thereto. A component(e.g., the processor, the speaker 240, the inertia sensor 220, the soundsensor 230, and the wear detecting sensor 210) included in one earpiece250 of the pair of the earpieces 250 may be wirelessly connected to acomponent included in the other earpiece 250 via the communicationmodule. The component included in the earpiece 250 may wirelesslytransmit and receive data and/or a signal to and from the componentincluded in the other earpiece 250 via the communication module.

The earpiece 250 may be a piece covering one ear of the user when theelectronic device 200 is worn, and may be provided as a pair. Theearpiece 250 may accommodate at least one or a combination of two ormore of the wear detecting sensor 210, the inertia sensor 220, the soundsensor 230, the speaker 240, the touch sensor 260, the processor, andthe communication module. Components included in the electronic device200 may be distributed and accommodated in each of the earpieces 250.The pair of earpieces 250 may be connected to each other through thehousing (e.g., the headband 270). In case the electronic device 200 isworn on an ear of the user, the pair of earpieces 250 may seal each earof the user from ambient sound. For example, the earpiece 250 mayinclude an earpad for sealing the ear of the user from ambient sound.Although FIG. 2 illustrates that the earpiece 250 is larger than an earof the user, this example is not limited thereto. The earpiece 250 mayseal the ear by filling an external auditory meatus of the user, such asa canal type. Since a shape of a stereo headset device in an on-ear orover-ear type is designed to focus on sound quality by shieldingexternal noise, the stereo headset device may be vulnerable to externalnoise detection, and thus, may require determining danger, as describedbelow.

In addition, a physical control interface may be provided in theearpiece 250 (e.g., an outer surface of the earpiece 250) and/or theheadband 270. The physical control interface may be a physical userinterface (PUI) including a button and/or a switch. The physical controlinterface may receive a user input for turning on power or performing apredetermined function.

FIG. 3 illustrates an acceleration sensing axis of an electronic deviceaccording to an embodiment.

As described above with reference to FIG. 2 , an inertia sensor 320 ofan electronic device 300 may include an acceleration sensor (or anaccelerometer) and a gyro sensor (or a gyroscope). The accelerationsensor may sense force or acceleration applied in a linear directionalong an X axis, a Y axis, and a Z axis. For the electronic device 300,which is worn in a normal posture, in the acceleration sensor, the Yaxis may indicate a direction of gravity (e.g., a directionperpendicular to ground), the X axis may indicate a direction (e.g., adirection parallel to ground) perpendicular to the Y axis in the normalposture, and the Z axis may indicate a direction (e.g., a directionreverse to a direction of outputting sound by an earpiece) to which anouter surface of the earpiece faces in the normal posture. The gyrosensor may sense an angular velocity of rotation based on the X axis,the Y axis, and the Z axis. For reference, FIG. 3 illustrates theelectronic device 300 worn in the normal posture.

The electronic device 300 may include a pair of earpieces, and theinertia sensor may be accommodated in each of the earpieces. In otherwords, the electronic device 300 may include a pair of the inertiasensors. The pair of the inertia sensors may be placed symmetrical toeach other. For example, the pair of the inertia sensors may be placedsymmetrical based on a virtual surface between the earpieces. In theinertia sensor of the electronic device 300 worn by a user in a normalposture, a Y axis may be a direction of gravity, and an X axis may be adirection of a gaze and/or a head of the user wearing the electronicdevice 300 while being perpendicular to the Y axis. A ZL axis may be a Zaxis of the inertia sensor accommodated in an earpiece worn on the leftear of the user. A ZR axis may be a Z axis of the inertia sensoraccommodated in an earpiece worn on the right ear of the user. The ZLaxis and the ZR axis may be parallel to each other when worn by theuser; however, these axes may be in opposite directions to each other.

FIG. 4 is a flowchart illustrating an operating method of an electronicdevice according to an embodiment.

In step 410, while worn by a user, an electronic device 200 may collectinformation related to at least one of movement, posture, and ambientsound of the user, or a combination of two or more thereof. As describedabove, a user wearing a stereo headset device, which has an earpiecethat seals an ear of the user, may be exposed to a potentially dangeroussituation due to sound sealing. For example, the electronic device maycollect information related to movement of the user (e.g., accelerationdata, a moving distance, a moving speed, a moving acceleration, and amoving direction of the user), information related to a posture (e.g., adirection in which a head is pointing, an angular velocity of headrotation, an angular acceleration of head rotation, and angularacceleration data), ambient sound (e.g., an obtained sound signal), andinformation related to ambient sound (e.g., a volume level of sound), asvarious pieces of data for determining whether the user is in danger.

In step 420, the electronic device may determine whether the user is indanger, based on the collected information. For example, the electronicdevice may determine whether the user is in danger, based on at leastone or a combination of two or more of the information related tomovement of the user, the information related to a posture, and theinformation related to ambient sound.

In step 430, in case the user is in danger, the electronic device mayprovide the ambient sound to the user. The electronic device may outputthe ambient sound collected while determining that the user is indanger. The electronic device may continue to provide the ambient soundduring a predetermined play time and/or until the danger to the userdisappears.

Hereinafter, an operation of determining whether the user is in dangerby using collected data is described according to various embodiments.

FIGS. 5 and 6 illustrate an operation, performed by an electronicdevice, of determining danger, based on whether a head of a user hasrotated, according to an embodiment.

In step 511, an electronic device may monitor whether a user wears theelectronic device. For example, the electronic device may determinewhether earpieces cover both ears of the user. The electronic device maydetermine whether the electronic device is worn, based on data obtainedby the above-described wear detecting sensor. For example, theelectronic device may determine that the user is wearing the electronicdevice in case a distance, which is calculated by the data obtained bythe wear detecting sensor, between the earpieces and a head of the useris less than a threshold distance.

In step 512, the electronic device may collect sensing data(hereinafter, referred to as “angular velocity data”) of a gyro sensorwhile the electronic device is worn. For example, while the electronicdevice is worn on an ear of the user, the electronic device may collectthe angular velocity data of the electronic device. However, thisexample is not limited thereto, and the electronic device may alsocollect acceleration data together with the angular velocity data whilethe electronic device is worn on the ear of the user. For reference, theelectronic device may collect at least one of the angular velocity dataand the acceleration data from a time point of detecting the electronicdevice being worn on the head of the user to a time point of removingthe electronic device from the user's head.

In step 521, the electronic device may determine whether the head of theuser is rotated, based on inertia information (e.g., the accelerationdata and the angular velocity data). The electronic device may determinethat the user is in danger in response to detecting head rotation, whichexceeds at least one of a critical angular velocity and a criticalangular velocity slope, based on the inertia information. The electronicdevice may detect a rapid change in an angular velocity and/or anangular acceleration while monitoring the collected angular accelerationdata. Even without a physical interface, the electronic device mayprovide an ambient sound-hearing function in case rapid head rotation isdetected as an intended input by the user.

FIG. 6 represents sensing data 610 while the user does not rotate thehead and sensing data 620 while the user rotates the head, and thesensing data 610 and the sensing data 620 may represent a change 600 inan angular velocity value for each axis over time. A unit of the angularvelocity illustrated in FIG. 6 may be a degree per second (dps). Asshown in FIG. 6 , in the sensing data 610 while the user does not rotatethe head, a peak of the angular velocity may not appear, or in case thepeak thereof appears, a peak 611 may have a low angular velocity value(e.g., 700 dps). In contrast, in the sensing data 620 while the userrotates the head, a plurality of peaks thereof may appear, and a peak621 may have a relatively high angular velocity value (e.g., 3900 dps).The peak may appear in the angular velocity based on an X axis, theangular velocity based on a Y axis, and the angular velocity based on aZ axis.

For example, the electronic device may monitor the angular velocitybased on each axis, and in case a monitored angular velocity exceeds acritical angular velocity (e.g., 3000 dps), the electronic device maydetermine that head rotation (e.g., rapid head rotation) has occurred.In another example, the electronic device may monitor the angularvelocity based on each axis, and in case a slope (e.g., an angularacceleration) of a monitored angular velocity exceeds a critical angularvelocity slope (e.g., a critical angular acceleration), the electronicdevice may determine that head rotation has occurred. In anotherexample, in case the angular velocity exceeds the critical angularvelocity and the angular acceleration exceeds the critical angularacceleration, the electronic device may determine that head rotation hasoccurred.

In case the electronic device determines that head rotation of the userhas occurred as described in step 521, in step 522, the electronicdevice may determine that the user is in danger.

As described in step 430 of FIG. 4 , in case the electronic device hasdetermined that the user is in danger, the electronic device mayactivate ambient sound hearing during a predetermined play time. Forreference, examples of FIGS. 11 and 12 may additionally determinewhether the user has responded; however, in FIG. 5 , head rotation ofthe user may already indicate and/or imply that the user is in danger.The embodiment shown in FIG. 5 , for determining whether the user is indanger, may require determining that head rotation is sufficient, andmay not require determining whether the user has responded.

FIGS. 7 to 10 illustrate an operation, performed by an electronicdevice, of determining danger based on a moving direction and a headorientation of a user, according to an embodiment.

In step 711, an electronic device may monitor whether a user wears theelectronic device.

In step 712, the electronic device may collect sensing data (e.g.,inertia information of the electronic device) by an inertia sensor,while the electronic device is worn on an ear of the user. As describedabove, the electronic device may collect acceleration data and angularvelocity data.

In step 721, the electronic device may monitor a mismatch between amoving direction and a head orientation of the user, by using theinertia information. The moving direction may represent a direction inwhich the body of the user, who wears the electronic device, moves. Thehead orientation may represent a direction in which the head (e.g., thenose) of the user, who wears the electronic device, points. The mismatchbetween the moving direction and the head orientation may represent thata direction in which the user moves is different from a direction inwhich the user gazes.

For example, the electronic device may determine whether the user iswalking by using the acceleration data, such as a pedometer, and in casethe user is walking, the electronic device may determine a movingdirection based on walking. In addition, the electronic device mayestimate a walking posture through force applied to each axis of anacceleration sensor while walking. For example, the electronic devicemay estimate a posture based on force applied to each axis (e.g., the Xaxis, the Y axis, and the Z axis) as moving forward, and impulse up anddown along an axis (e.g., the Y axis). In case vibration up and downalong an axis (e.g., the Y axis) and force that occurs by moving forwardshift to another axis, the electronic device may determine that theuser, who is walking, drops the head or looks up. In this example, headrotation based on one axis (e.g., the Z axis) may be detected based onthe acceleration data only.

In another example, the electronic device may determine the mismatchbetween the moving direction and the head orientation based on acorrelation between acceleration data of the inertia sensor (e.g., theacceleration sensor) accommodated in an earpiece and acceleration dataof the inertia sensor accommodated in the other earpiece. Referring toFIG. 10 , in case a correlation between first acceleration data 1001obtained by sensing at a position corresponding to one of a pair ofspeakers and second acceleration data 1002 obtained by sensing at aposition corresponding to the other speaker falls outside apredetermined threshold range, the electronic device may determine thata mismatch between the moving direction and the head orientation hasoccurred. FIG. 8 illustrates acceleration data 800 measured by aninertia sensor accommodated in each earpiece. An upper graph in theacceleration data 800 may represent acceleration values obtained bysensing at a position corresponding to the left earpiece and a leftspeaker, and a lower graph may represent acceleration values obtained bysensing at a position corresponding to the right earpiece and a rightspeaker. In a first time period 810, a correlation between leftacceleration values and right acceleration values may not appear. On theother hand, in a second time period 820 in which a user is walking whilerotating the head, inverted waves, which are inverted to each other, ofthe left acceleration values and the right acceleration values mayappear in a period 821. The inverted waves may imply that a correlationbetween the first acceleration data 1001 and the second accelerationdata 1002 is −1 in the period 821. In case there is no correlationbetween axes of both acceleration sensors, the electronic device maydetermine that the moving direction and the head orientation aredifferent.

In another example, the electronic device may estimate the movingdirection of the user by using the acceleration data of the accelerationsensor. The electronic device may estimate the head orientation of theuser by using the angular velocity data of a gyro sensor. The electronicdevice may calculate an angular difference between the moving directionand the head orientation. In case the calculated angular differenceexceeds a critical angular difference, the electronic device maydetermine that a mismatch between the moving direction and the headorientation has occurred.

In another example, the electronic device may receive potential externalcollision information from another external electronic device (e.g., anelectronic device 104 of FIG. 1 ). The potential external collisioninformation may be information on whether another device (e.g., avehicle or a motorcycle) close to the user may collide with the user,and may be, for example, information indicating whether the other deviceis approaching a current location of the user or an expected moving pathof the user. The other external electronic device may generate thepotential external collision information by receiving, from anotherdevice, at least one of a moving direction, a moving speed, a movingacceleration, and a moving path of the other device, or a combination oftwo or more thereof. The electronic device may determine danger based onthe moving direction of the user and the potential external collisioninformation received from the other external electronic device.

With respect to step 721, determining a mismatch based on a correlationis described below. For example, referring to FIG. 9 , in step 910, anelectronic device may determine head rotation. The electronic device maydetect the head rotation based on inertia information. Detecting thehead rotation may be performed similarly to step 521 of FIG. 5 ;however, the example is not limited thereto. For example, the electronicdevice may determine a time point when head rotation of the user istriggered based on angular velocity values obtained by sensing by a gyrosensor of inertia sensors. For reference, the critical angular velocity(e.g., the first critical angular velocity) of FIG. 5 may have adifferent value from a critical angular velocity used in FIG. 9 , and afurther description is provided with reference to FIG. 13 .

In step 920, the electronic device may calculate a correlation betweenaccelerations of both sides. The accelerations of both sides may includethe first acceleration data 1001, as shown if FIG. 10 , obtained bysensing by a first inertia sensor accommodated in a first earpiece andthe second acceleration data 1002 obtained by sensing by a secondinertia sensor accommodated in a second earpiece. For example, theelectronic device may calculate a correlation between the firstacceleration data 1001 and the second acceleration data 1002, based onan axis (e.g., the ZL axis and the ZR axis) perpendicular to an outersurface of the earpiece.

As shown in FIG. 10 , the electronic device may respectively extract,from the first acceleration data 1001 and the second acceleration data1002, first target acceleration data and second target acceleration datacorresponding to a time period 1020 (e.g., 3 seconds) determined by atime point of detecting the head rotation.

The electronic device may calculate a correlation between the firsttarget acceleration data and the second target acceleration data. Theelectronic device may calculate the correlation between the first targetacceleration data and the second target acceleration data based onEquation (1) shown below.

$\begin{matrix}{{corr}_{LR} = \frac{\sum_{i}^{n}{\left( {{Acc}_{L,i} - \overset{\_}{{Acc}_{L}}} \right)\left( {{Acc}_{R,i} - \overset{\_}{{Acc}_{R}}} \right)}}{\sqrt{\sum_{i}^{n}\left( {{Acc}_{L,i} - \overset{\_}{{Acc}_{L}}} \right)^{2}}\sqrt{\sum_{i}^{n}\left( {{Acc}_{R,i} - \overset{\_}{{Acc}_{R}}} \right)^{2}}}} & (1)\end{matrix}$

In Equation (1), n may be an integer greater than or equal to 1 and maydenote a sampling number within the time period 1020, and i may be aninteger greater than or equal to or 1 and less than or equal to n andmay denote an index corresponding to a time point when an accelerationvalue in the first target acceleration data and the second targetacceleration data is sampled. ACC_(L,i) and ACC_(R,i) may respectivelydenote an i-th acceleration value in the first target acceleration data(e.g., left acceleration data) and an i-th acceleration value in thesecond target acceleration data (e.g., right acceleration data). ACC_(L)and ACC_(R) may respectively denote an average value of the first targetacceleration data within the time period 1020 and an average value ofthe second target acceleration data within the time period 1020.Examples of correlation samples 1090 illustrated in FIG. 10 mayrepresent acceleration values sampled within the time period 1020 with avalue of the ZL axis as the horizontal axis and a value of the ZR axisas the vertical axis. In case a correlation is 0, a random pattern mayappear, in case the correlation approaches 1, a linearly increasingshape may appear, and in case the correlation approaches −1, a linearlydecreasing shape may appear.

In step 930, the electronic device may determine whether the calculatedcorrelation falls outside a predetermined threshold range. For example,the electronic device may determine whether a correlation coefficient(e.g., a coefficient calculated based on Equation (1)) indicating acorrelation calculated for a predetermined time period (e.g., 3 seconds)from a time point 1010, when head rotation is detected, to a time point1020 falls outside a threshold range less than or equal to 1 and greaterthan −0.5. In other words, the electronic device may determine that thecorrelation coefficient falls within a range (e.g., a mismatch range)less than or equal to −0.5 and greater than −1. In case the calculatedcorrelation falls outside the threshold range and falls within themismatch range, the electronic device may determine that a movingdirection does not match a head orientation of a user. In case thecorrelation falls within the threshold range, the electronic device mayreturn to step 712 of FIG. 7 and continue to collect the inertiainformation.

In step 722, the electronic device may determine whether the user is indanger based on a result of monitoring the mismatch between the movingdirection and the head orientation. In case the mismatch is detected,the electronic device may determine that the user is in danger.

As described in step 430 of FIG. 4 , in case the electronic device hasdetermined that the user is in danger, the electronic device mayactivate ambient sound hearing during a predetermined play time.

FIGS. 11 and 12 illustrate an operation, performed by an electronicdevice, of determining danger based on a response of a user according toan embodiment.

In step 1111, an electronic device may monitor whether a user wears theelectronic device.

In step 1112, the electronic device may collect sensing data (e.g., asound signal including ambient sound) through a sound sensor (e.g., amicrophone) while the electronic device is worn on an ear of the user.

In step 1121, the electronic device may monitor whether a volume levelof the ambient sound exceeds a threshold volume level 1290 of FIG. 12 .In case the volume level of sound collected through the sound sensorexceeds the threshold volume level 1290, the electronic device maydetermine whether the user has responded. In the present disclosure, thesound exceeding the threshold volume level 1290 may be referred to as animpact sound. In case the volume level of the sound collected throughthe sound sensor is less than or equal to the threshold volume level1290, the electronic device may return to step 1112 and continue tocollect the sound signal. As shown in graph 1200 of FIG. 12 , theelectronic device may calculate an average volume level value forambient sound for a previous time period 1210 (e.g., from time point t1to time point t2) during a predetermined time length based on a targettime point (e.g., a current time point). The average volume level valuemay be a volume level of sound caused by continuous white noise. Theelectronic device may determine a threshold volume level 1290 based onthe average volume level value of the previous time period 1210. Thethreshold volume level 1290 may be set to a volume level which isgreater than the average volume level value by a predetermined offsetvolume level (e.g., 70 dB). In case a sound peak 1220 is detected whilemonitoring the ambient sound, the electronic device may determinewhether the collected sound is impact sound by comparing the sound peakto the threshold volume level.

In step 1122 of FIG. 11 , the electronic device may collect the sensingdata of the inertia sensor. For example, the electronic device maycollect acceleration data and/or angular velocity data for determiningresponsiveness of the user with respect to the impact sound.

In step 1123, the electronic device may determine whether the user hasperformed a response action. According to an embodiment, the electronicdevice may determine whether the user has responded based on performinga response action including at least one or a combination of two or moreof a response time, a response magnitude, and a response direction ofthe user for the impact sound, which exceeds the threshold volume level1290.

For example, the electronic device may determine whether the user hasresponded to the impact sound based on the response time. The electronicdevice may determine whether the head of the user rotates within athreshold response time from a time point of detecting the impact sound.The electronic device may determine that the user has responded to theimpact sound in case the head of the user rotates within the thresholdresponse time. In another example, the electronic device may determinewhether the user has responded to the impact sound based on the responsemagnitude. In response to the impact sound, the electronic device maydetermine the response magnitude based on a speed of head rotation(e.g., a rotation angular velocity) and an acceleration of the headrotation (e.g., a rotation angular acceleration), and in case theresponse magnitude exceeds the threshold response magnitude, theelectronic device may determine that the user has responded to theimpact sound. In another example, the electronic device may determinewhether the user has responded to the impact sound based on the responsedirection. In case head orientation of the user points to a directionwhere a sound source causing the impact sound is located, the electronicdevice may determine that the user has responded.

In addition, based on the response time and the response direction, theelectronic device may determine that the user has responded. In case thehead orientation of the user points to a location where the impact soundhas occurred within the threshold response time determined based on thevolume level of the impact sound, the electronic device may determinethat the user has responded.

For example, based on a difference of sound by a same sound sourcebetween a volume level sensed by a sensor disposed in one earpiece(e.g., a left sound sensor) and a volume level sensed by a sensordisposed in another earpiece (e.g., a right sound sensor), theelectronic device may estimate a relative position and/or a direction ofthe sound source. The electronic device may determine whether the headorientation of the user is changed to point toward an estimated locationof the sound source, based on acceleration data and/or angular velocitydata of the inertia sensor. In other words, the electronic device maydetermine whether the user has responded toward a direction of the soundsource causing the impact sound. For example, in case the user hasquickly responded to the left within the threshold response time or atleast one condition is satisfied in response to sound from a left sidebased on the electronic device, the electronic device may determine thatthe user has responded.

The electronic device may set the threshold response time based on adifference between an average volume level in the previous time period1210 and a volume level of the impact sound. The electronic device maydetermine the threshold response time, which is inversely proportionalto the difference between the average volume level and the volume levelof the impact sound. The threshold response time described above may becalculated by Equation (2) shown below.

$\begin{matrix}{{RespTime} = {\frac{1}{{{Impact}{dB}} - {{Average}{dB}}} \times 50\left( {s{ec}} \right)}} & (2)\end{matrix}$

In Equation (2), RespTime may denote a threshold response time, ImpactdBmay denote a volume level of an impact sound, and AveragedB may denotean average volume level in the previous time period 1210. For example,in case an impact sound of 100 dB has occurred while AveragedB is 50 dB,the electronic device may set the threshold response time to 1 sec.However, the above-described Equation (2) is merely an example, and theexample is not limited thereto. The electronic device may demand afaster response time from a user as noise of which a volume level isgreater than the average volume level has occurred.

The electronic device may determine whether the user is in danger basedon the determined response. In case the head orientation of the userdoes not face toward a location where the impact sound has occurreduntil the threshold response time, which is determined based on thevolume level of the impact sound, elapses, the electronic device maydetermine that the user is in danger. As described in step 430 of FIG. 4, in case the electronic device has determined that the user is indanger, the electronic device may activate ambient sound hearing duringa predetermined play time. For example, in response to a late responseor no response from the user, the electronic device may automaticallyactivate ambient sound hearing for inducing a user response since theuser may miss the impact sound because of using the stereo headsetdevice. The electronic device may provide the ambient sound to the userwho is determined to be in danger through a pair of speakers, based onthe impact sound exceeding the threshold volume level. Thereafter, incase ambient noise decreases, the electronic device may deactivate anambient sound hearing function. In case the impact sound has beenremoved, the electronic device may terminate providing ambient soundthrough the pair of speakers. Therefore, the electronic device mayinduce an appropriate user response to the surrounding environment byautomatically activating ambient sound hearing during a predeterminedperiod in case the user is in danger.

The electronic device may determine that the user is safe in case theuser has responded normally within the threshold response time. Whilethe user is safe, the electronic device may deactivate ambient soundplaying.

FIG. 13 is a flowchart illustrating an operation, performed by anelectronic device, of determining danger based on head rotation, amismatch between a moving direction and a head orientation, and a userresponse, and providing ambient sound.

In step 1311, the electronic device may monitor whether the electronicdevice is worn. As described above, the electronic device may determinewhether an earpiece of the electronic device is closely worn on an earof a user through a wear detecting sensor. The electronic device maycollect various pieces of information after the electronic device hasbeen worn.

The electronic device may generate inertia information of the electronicdevice by an inertia sensor while the electronic device is worn on theear of the user. For example, in step 1312, the electronic device maycollect data of a gyro sensor while the electronic device is worn. Instep 1313, the electronic device may collect data of an accelerationsensor while the electronic device is worn. In step 1314, the electronicdevice may collect data of a sound sensor while the electronic device isworn.

In step 1321, the electronic device may determine whether an angularvelocity monitored by the gyro sensor exceeds a first critical angularvelocity. The electronic device may continue to collect data, in casethe angular velocity is less than or equal to the first critical angularvelocity. In response to the angular velocity exceeding the firstcritical angular velocity, the electronic device may determine thatrapid head rotation has occurred, and in step 1326, the electronicdevice may determine that the user is in danger.

In step 1322, the electronic device may determine a mismatch between amoving direction and a head orientation. For example, in case headrotation has occurred, the electronic device may determine, similar tostep 721 of FIG. 7 , a mismatch between a moving direction and a rotatedhead orientation. Here, the electronic device may determine that thehead rotation has occurred in case the angular velocity is less than orequal to the first critical angular velocity and exceeds a secondcritical angular velocity. The second critical angular velocity may beless than the first critical angular velocity. In other words, in casethe speed of the head rotation, which is slower than the head rotationin step 1321, has occurred, the electronic device may determine whetherthe user is in danger by additionally considering the mismatch betweenthe moving direction of the body and the rotated head orientation.

In step 1323, the electronic device may determine whether a volume levelof sound exceeds a threshold volume level. In case the impact sound isnot detected, the electronic device may continue to collect sound. Instep 1324, in case the impact sound is detected, the electronic devicemay collect inertia sensor data. In step 1325, the electronic device maydetermine whether the user has responded based on inertia information.For example, the electronic device may determine that the user is indanger in case the electronic device fails to detect head rotation ofthe user from a time point of detecting sound, which is greater than orequal to the threshold volume level, from ambient sound, until apredetermined threshold response time elapses.

In step 1326, the electronic device may determine whether the user is indanger based on above-described steps 1321, 1322, and 1325.

As described above in FIG. 4 , in step 430, the electronic device mayprovide ambient sound to the user in case the user is in danger. Forexample, a pair of speakers of the electronic device may outputcollected ambient sound to the user while the user is in danger.

According to an embodiment, the electronic device may control an ambientsound-hearing function by using data collected by a microphone and aninertia sensor typically installed on the stereo headset device. Asdescribed above, the electronic device may activate the ambientsound-hearing function when the function is needed by detecting the headrotation by the inertia sensor and detecting a time point when theambient sound-hearing function is needed through the microphone.Therefore, in case of an emergency, the electronic device may induce anecessary response from the user, who wears the stereo headset thatseals the ambient sound, through the ambient sound-hearing functionwhile minimizing disturbance to music being listened to.

According to an embodiment, an electronic device may prevent a danger,which may occur as a user, who wears a stereo headset device, moves, byproviding ambient sound in case a moving direction of a body part and ahead orientation of the user does not match.

According to an embodiment, an electronic device may prevent a user frombeing exposed to a danger, which has occurred from a direction in whicha user does not gaze, by providing ambient sound based on head rotation.

According to an embodiment, an electronic device may secure user safetyby calling attention of a user, who wears a stereo headset device thatseals ambient sound, by providing the ambient sound in case a volumelevel of the ambient sound is high.

Additionally, the electronic device may provide convenience to the userby activating the ambient sound playing without additional control inresponse to an action of nodding of the head as intended by the user andan utterance exceeding a threshold volume level from the mouth of theuser. In response to determining that activation of the ambient soundhearing is required without a complicated control, the electronic devicemay induce activation of the ambient sound playing by performing theabove-described actions.

While the disclosure has been particularly shown and described withreference to certain embodiments thereof, it will be understood by thoseof ordinary skill in the art that various changes in form and detailsmay be made therein without departing from the spirit and scope of thedisclosure as defined by the appended claims and their equivalents.

What is claimed is:
 1. An electronic device comprising: an inertiasensor configured to sense inertia of the electronic device while theelectronic device is worn on an ear of a user; a processor configured tomonitor a mismatch between a moving direction and a head orientation ofthe user by using inertia information on the sensed inertia, anddetermine whether the user is in danger based on a result of monitoringthe mismatch between the moving direction and the head orientation; asound sensor configured to collect ambient sound; and a pair of speakersconfigured to output collected ambient sound while the user isdetermined to be in danger.
 2. The electronic device of claim 1, furthercomprising: an earpiece configured to seal the ear of the user from theambient sound in case the electronic device is worn on the ear of theuser; and a housing accommodating the pair of speakers and connected tothe earpiece.
 3. The electronic device of claim 1, wherein the processoris further configured to determine that the mismatch between the movingdirection and the head orientation has occurred in case a correlationbetween first acceleration data obtained by sensing at a positioncorresponding to one of the speakers and second acceleration dataobtained by sensing at a position corresponding to the other speakerfalls outside a predetermined threshold range.
 4. The electronic deviceof claim 3, wherein the processor is further configured to: detect headrotation based on the inertia information, extract, from the firstacceleration data and the second acceleration data, respectively, firsttarget acceleration data and second target acceleration datacorresponding to a time period determined based on a time point when thehead rotation is detected, and calculate the correlation between thefirst target acceleration data and the second target acceleration data.5. The electronic device of claim 1, wherein the processor is furtherconfigured to determine that the user is in danger in case headrotation, which exceeds at least one of a critical angular velocity anda critical angular velocity slope based on the inertia information, isdetected.
 6. The electronic device of claim 1, wherein the processor isfurther configured to, in case a volume level of sound collected throughthe sound sensor exceeds a threshold volume level, determine whether theuser has performed a response action, and determine whether the user isin danger based on the determination whether the user has performed theresponse action.
 7. The electronic device of claim 6, wherein theprocessor is further configured to determine whether the user hasperformed the response action to impact sound, which exceeds thethreshold volume level, based on performing a response action includingat least one or a combination of two or more of a response time, aresponse magnitude, and a response direction of the user.
 8. Theelectronic device of claim 7, wherein the processor is furtherconfigured to determine that the user is safe in case the headorientation of the user points to a location in which the impact soundhas occurred within a threshold response time determined based on avolume level of the impact sound.
 9. The electronic device of claim 7,wherein the processor is further configured to determine that the useris in danger in case the head orientation of the user does not point toa location in which the impact sound has occurred until a thresholdresponse time, determined based on a volume level of the impact sound,elapses.
 10. The electronic device of claim 1, wherein the processor isfurther configured to provide the ambient sound through the pair ofspeakers to the user who is determined to be in danger, based on impactsound exceeding a threshold volume level, and terminate providing theambient sound through the pair of speakers in case the impact sound hasbeen removed.
 11. A method performed by an electronic device, the methodcomprising: sensing inertia of the electronic device while theelectronic device is worn on an ear of a user; monitoring a mismatchbetween a moving direction and a head orientation of the user by usinginertia information related to the sensed inertia; determining whetherthe user is in danger based on a result of monitoring the mismatchbetween the moving direction and the head orientation; and outputtingcollected ambient sound while determining that the user is in danger.12. The method of claim 11, wherein determining whether the user is indanger comprises determining that the mismatch between the movingdirection and the head orientation has occurred in case a correlationbetween first acceleration data obtained by sensing at a positioncorresponding to one of a pair of speakers and second acceleration dataobtained by sensing at a position corresponding to the other speakerfalls outside a predetermined threshold range.
 13. The method of claim12, wherein monitoring the mismatch comprises: detecting head rotationbased on the inertia information; extracting, from the firstacceleration data and the second acceleration data respectively, firsttarget acceleration data and second target acceleration datacorresponding to a time period determined based on a time point when thehead rotation is detected; and calculating the correlation between thefirst target acceleration data and the second target acceleration data.14. The method of claim 11, further comprising: determining that theuser is in danger in case head rotation, which exceeds at least one of acritical angular velocity and a critical angular velocity slope based onthe inertia information, is detected.
 15. The method of claim 11,further comprising: in case a volume level of sound collected through asound sensor exceeds a threshold volume level, determining whether theuser has performed a response action; and determining whether the useris in danger based on the determination whether the user has performedthe response action.
 16. The method of claim 15, wherein determiningwhether the user has performed the response action comprises determiningwhether the user has responded to impact sound, which exceeds thethreshold volume level, based on performing a response action includingat least one or a combination of two or more of a response time, aresponse magnitude, and a response direction of the user.
 17. The methodof claim 16, wherein determining whether the user is in danger based onthe determination whether the user has performed the response actioncomprises determining that the user is safe in case the head orientationof the user points to a location in which the impact sound has occurredwithin a threshold response time determined based on a volume level ofthe impact sound.
 18. The method of claim 16, wherein determiningwhether the user is in danger based on the determination whether theuser has performed the response action comprises determining that theuser is in danger in case the head orientation of the user does notpoint to a location in which the impact sound has occurred until athreshold response time, determined based on a volume level of theimpact sound, elapses.
 19. A non-transitory computer-readable storagemedium storing instructions that, when executed by a processor, causethe processor to perform the method of claim
 11. 20. An electronicdevice comprising: an inertia sensor configured to sense inertia of theelectronic device while the electronic device is worn on an ear of auser; a sound sensor configured to collect ambient sound; a processorconfigured to determine that the user is in danger in response to afailure in detecting head rotation of the user by using inertiainformation related to the sensed inertia from a time point of detectingsound, which exceeds a threshold volume level, from ambient sound untila predetermined threshold response time elapses; and a pair of speakersconfigured to output collected ambient sound while the user is indanger.